-
Notifications
You must be signed in to change notification settings - Fork 5
Fix MBM Implementation. #132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #132 +/- ##
==========================================
- Coverage 99.35% 99.35% -0.01%
==========================================
Files 17 17
Lines 1858 1855 -3
==========================================
- Hits 1846 1843 -3
Misses 12 12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
… and per-bound M value usage
| M::Dict{LogicalVariableRef{M}, T} | ||
| default_M::T | ||
| conlvref::Vector{LogicalVariableRef{M}} | ||
| M::Dict{LogicalVariableRef{M}, Union{T, Vector{T}}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now storing M values for vector constraints as vectors to reflect unique values in each of rows.
This PR fixes the MBM implementation to use the tightest M values possible. This means that each disjunct constraint has it's own M value associated with any other disjunct. Originally only disjuncts has corresponding M values.
EXAMPLE
Given a disjunction with:
x <= 2andx >= 10 <= x <= 55When reformulating Y[1]'s constraints with respect to Y[2]'s feasible region (0 ≤ x ≤ 55):
x <= 2: max(x - 2) → M = 53 (at x = 55)x >= 1: max(1 - x) → M = 1 (at x = 0)Before (max M of possible constraints):
x - 53·Y[2] <= 2
x + 53·Y[2] >= 1 ← Both use M = max(53, 1) = 53
After (per-constraint):
x - 53·Y[2] <= 2 ← Uses its own M = 53
x + 1·Y[2] >= 1 ← Uses its own M = 1 (tighter)
The code is largely the same. The change made is
maximum(_maximize_M(...))is now just_maximize_M(...), and order of for loops was adjusted to reflect this.Relevant tests were added to check for these unique M values in addition to verbose comments.